package com.easy.service.impl;

import com.easy.bean.Course;
import com.easy.dao.ICourseDao;
import com.easy.service.ICourseService;
import com.easy.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class CourseServiceImpl implements ICourseService {

    @Autowired
    ICourseDao dao;

    @Override
    public List<Course> getPrivateCourse(Course course, Page page) {
        return dao.getPrivateCourse(course,page);
    }

    @Override
    public int getPrivateCourseCount(Course course) {
        return dao.getPrivateCourseCount(course);
    }

    @Override
    public Course getCourseByID(int id) {
        return dao.getCourseByID(id);
    }

    @Override
    public int addPrivateCourse(Course course) {
        return dao.addPrivateCourse(course);
    }

    @Override
    public int delCourseByID(int id) {
        return dao.delCourseByID(id);
    }

    @Override
    public int editPrivateCourse(Course course) {
        return dao.editPrivateCourse(course);
    }

    @Override
    public List<Course> getPublicCourse(Course course, Page page) {
        return dao.getPublicCourse(course,page);
    }

    @Override
    public int getPublicCourseCount(Course course) {
        return dao.getPublicCourseCount(course);
    }

    @Override
    public int addPublicCourse(Course course) {
        return dao.addPublicCourse(course);
    }

    @Override
    public int editPublicCourse(Course course) {
        return dao.editPublicCourse(course);
    }

    @Override
    public List<Course> getAllCourse() {
        return dao.getAllCourse();
    }
}
